package com.cryrabbit.yyystitp.net;

import retrofit2.http.POST;
import retrofit2.http.Query;
import rx.Observable;
import rx.Subscriber;
import rx.android.schedulers.AndroidSchedulers;
import rx.schedulers.Schedulers;

/**
 * Created by CryRabbit on 2017/5/10.
 */

public class RegisterHttpMethods extends BaseHttpMethods{
    private RegisterService registerService;
    public RegisterHttpMethods(){
        super();
        registerService=retrofit.create(RegisterService.class);
    }
    public void getNet(Subscriber<String> stringSubscriber, String user, String pass){
        registerService.getResult(user,pass)
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(stringSubscriber);
    }
    private interface RegisterService{
        @POST("yyy/register")
        Observable<String> getResult(@Query("uname") String user, @Query("upwd") String pass);
    }
}
